1. Field of The Invention
The present invention relates to the process of bit, byte and word swapping, and particularly to implementing processor functions by swapping bits, bytes and words.
2. State of The Art
In a digital processing system, functions or operations are performed on digital words by manipulating or swapping the bits (single bit), nibbles (4-bits), bytes (8-bits), or half words (16-bits) of a digital word. For instance, a well known operation performed within processing systems is changing the format of a digital word from a big endian format to a little endian format. In particular, a digital word in a big endian format has its least significant bit starting from the highest order address of the word. A word in a little endian format has its least significant bit starting from the lowest order address of the word. Often times when interfacing between processing systems, bit swapping is required to accommodate the particular endian format of the system receiving or sending the data. Swapping might also be performed for other operations within the processing system such as a bit field extraction or a Viterbi operation.
In general, the manner in which swapping was previously performed was to design a system that is hardwired to perform only one particular swapping pattern. For instance, a hardwired system might be designed to exclusively perform a big endian to little endian bit swapping operation. However, providing hardware circuitry for performing swapping in this manner can result in a significant amount of additional hardware depending on the amount and type of swapping required in the system. Another typical prior art swapping design technique utilizes large multiplexers having many inputs which are controlled with complex control signaling resulting in significant space and power usage. Alternatively, swapping has been performed by a sequence of digital signal processing (DSP) steps such as shifting, masking, and storing. The disadvantage of performing swapping in this manner is that it can tie up valuable processing cycles retrieving and loading data and, in general, can take many processing cycles to accomplish.
The present invention is an apparatus and system that is programmable to perform any random bit, nibble, byte, and half word swap utilizing simplified multiplexer circuitry and minimal control signaling thereby obviating hardwired swapping systems, complex high-power multiplexer systems, and DSP swapping techniques.